# ----------------------------
# coding: utf-8
# 开发作者 : 钱嘉龙
# 创建日期 : 2022/3/27 16:16
# ----------------------------
import os

path = '..\\yolov4-pytorch-master\\VOCdevkit\\VOC2007\\JPEGImages'
files = [i for i in os.listdir(path)]  # os.listdir返回指定目录下的所有文件和目录名
for file, i in zip(files, range(len(files))):
    old = path + '/' + file
    new = path + '/' + '00000' + str(i+5751) + '.jpg'
    print(old)
    print(new)
    os.rename(old, new)
